package com.starlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.starlink.model.vo.mall.MallOrderCarCancelListVO;
import com.starlink.model.vo.mall.MallOrderDetailListVO;
import org.springframework.data.domain.Pageable;
import com.starlink.model.domain.ShoppingCartOrderDetailsDO;
import com.starlink.model.request.ShoppingCartOrderDetailsRequest;
import com.starlink.model.vo.ShoppingCartOrderDetailsVO;

import java.util.List;
import java.util.Map;

/**
 * @author zhanghong
 */
public interface ShoppingCartOrderDetailsService extends IService<ShoppingCartOrderDetailsDO> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    ShoppingCartOrderDetailsVO getByKey(long id);
    /**
     * 分页查询，手动分页
     * @param request
     * @return
     */
    PageInfo<ShoppingCartOrderDetailsVO> pageQuery(Pageable pageable,ShoppingCartOrderDetailsRequest request);
    /**
     * 列表查询
     * @param request
     * @return
     */
    List<ShoppingCartOrderDetailsVO> listQuery(ShoppingCartOrderDetailsRequest request);
    /**
     * 新增
     * @param request
     * @return
     */
    Boolean add(ShoppingCartOrderDetailsRequest request);
    /**
     * 根据主键更新
     * @param request
     * @return
     */
    Boolean updateByKey(ShoppingCartOrderDetailsRequest request);
    /**
     * 根据主键删除
     * @param ids
     * @return
     */
    Boolean deleteDOByIds(String ids);

    /**
     * 批量插入购物车订单详情
     * @param carOdersList
     */
    void batchInsert(List<ShoppingCartOrderDetailsDO> carOdersList);

    List<Map<String, Long>> selectQuantity(Long orderId,List<Long> carOrderIds);

    List<MallOrderCarCancelListVO> selectSpecificationId(Long orderId);

    void deleteCarOrderDetaile(Long orderId);

    MallOrderDetailListVO selectCarOrderDetail(Long orderId);

    /**
     * 通过商品ID查询订单规格ID和类别
     * @param key
     * @param orderId
     * @return
     */
    MallOrderCarCancelListVO selectDataInfoByAId(Long key, Long orderId);

    void updateIsRefunds(Long orderId, Long articlesId);

    List<MallOrderCarCancelListVO> selectSpecificationIdByOrderId(Long orderId);

    void deletedByOrderIds(String stringIds);
}
